<ui:composition
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">

    <div class="sidePanelComponents" >
        <ice:outputStyle href="/css/style.css" />

        <ice:form rendered="#{orderBackingBean.flightBooked}">
            <ice:panelGroup rendered="#{orderBackingBean.flightBooked}">
                <ice:outputLabel value="Flight"/>
                <ice:panelGrid columns="1" >
                    <ice:outputLabel value="Outbound"/>
                    <ice:outputText value="From: #{orderBackingBean.bookedFlight.fromAirport}"/>
                    <ice:outputText value="To: #{orderBackingBean.bookedFlight.toAirport}" />
                    <ice:outputText value="Dept time: #{orderBackingBean.bookedFlight.depTime}"/>
                    <ice:outputText value="Arr time: #{orderBackingBean.bookedFlight.arrTime}" />
                    <ice:outputText value="1 adult" />
                    <ice:outputText value="Price: #{orderBackingBean.bookedFlight.price}"/>
                </ice:panelGrid>
            </ice:panelGroup>
            <br/>
            <ice:panelGroup rendered="#{orderBackingBean.hotelBooked}">
                <ice:outputLabel value="Hotel"/>
                <ice:panelGrid columns="1" >
                    <ice:outputText value="Name: #{orderBackingBean.bookedHotel.name}"/>
                    <ice:outputText value="Closest city: #{orderBackingBean.bookedHotel.closestCity}" />
                    <ice:outputText value="Roomtype: #{hotelBackingBean.roomtype}" />
                    <ice:outputText value="# of nights: 7"/>
                    
                    <ice:outputText value="Price: #{orderUtilityBean.calculateTotalHotelPrice}"/>
                </ice:panelGrid>
            </ice:panelGroup>
            <ice:outputLabel value="Total price: #{orderUtilityBean.calculateTotalPrice}"/>

            <ice:commandButton value="Checkout" actionListener="#{orderControllerBean.doCheckout}" action="onDoCheckout">
                <f:attribute name="flight" value="#{orderBackingBean.flightBooked}" />
                <f:attribute name="hotel" value="#{orderBackingBean.hotelBooked}" />
                <f:attribute name="roomtype" value="#{hotelBackingBean.roomtype}" />
            </ice:commandButton>
            
        </ice:form>
    </div>
</ui:composition>